﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyOA.DAL;
using MyOA.Model;


namespace MyOA.BLL
{
    public class OperateFolderManage
    {
        OperateFolderService service = new OperateFolderService();

        /// <summary>
        /// 根据文件ID 查找文件信息
        /// </summary>
        /// <param name="fileId">文件ID</param>
        /// <returns>文件信息</returns>
        public FileInfo getFileInfoByFileId(int fileId)
        {
            return service.getFileInfoByFileId(fileId);
        }

        /// <summary>
        /// 根据登陆名查找登陆ID
        /// </summary>
        /// <param name="loginId">登陆名</param>
        /// <returns>登陆ID</returns>
        public int getUserIdByLoginId(string loginId)
        {
            return service.getUserIdByLoginId(loginId);
        }

        /// <summary>
        /// 根据文件ID来修改文件信息
        /// </summary>
        /// <param name="fileInfo">文件ID</param>
        /// <returns>是否修改成功</returns>
        public bool updateFileInfoByFileId(FileInfo fileInfo)
        {
            return service.updateFileInfoByFileId(fileInfo);
        }

        /// <summary>
        /// 根据文件ID找这文件的PARENTID
        /// </summary>
        /// <param name="fileId">文件ID</param>
        /// <returns>返回parentid</returns>
        public int getParentIdByFileId(int fileId)
        {
            return service.getParentIdByFileId(fileId);
        }

        /// <summary>
        /// 新增文件信息
        /// </summary>
        /// <param name="fileInfo">要新增的文件信息</param>
        /// <returns>是否新增成功</returns>
        public bool insertFileInfo(FileInfo fileInfo)
        {
            return service.insertFileInfo(fileInfo);
        }
    }
}
